﻿using Jet.Payment.Cielo.Model;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Jet.Payment.Cielo.Request
{
    [XmlRoot("requisicao-transacao")]
    public class TransactionRequest
    {
        public TransactionRequest()
        {
            Id = Guid.NewGuid().ToString();
            Version = "1.1.1";
            Capture = true;
        }

        [XmlAttribute("id")]
        public string Id { get; set; }
        [XmlAttribute("versao")]
        public string Version { get; set; }
        [XmlElement("dados-ec")]
        public ECData EC { get; set; }
        [XmlElement("dados-pedido")]
        public Order Order { get; set; }
        [XmlElement("forma-pagamento")]
        public PaymentType PaymentType { get; set; }
        [XmlElement("url-retorno")]
        public string UrlRetorno { get; set; }
        [XmlElement("autorizar")]
        public int AuthorizeInt { get { return (int)Authorize; } set { Authorize = (Authorize)value; } }
        [XmlIgnore]
        public Authorize Authorize { get; set; }
        [XmlElement("capturar")]
        public bool Capture { get; set; }

    }
}
